<?php


/*

	Copyright © 2011 Mike Bennett <mike@kereru.com>

	This file is part of Tazu-Time.

    Tazu-Time is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    Tazu-Time is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Tazu-Time.  If not, see <http://www.gnu.org/licenses/>.
    
*/

class control {

	// Record of control state
	public $state=array();		// Record of control state
	var $widget=FALSE;					// This control object

	function __construct($glade,$name) {

		$this->name = $name;
		$this->widget = $glade->get_widget($name);


	}

	/**
	*	Append one row
	*	
	*	@param	
	*	@return	
	*	
	*/
	function append($row_dat) {
		$this->model->append($row_dat);	
	}


	// Overridden    record state in to $this->state
	function get_state() {
	
	}

	// Overridden    restore state from $this->state
	function set_state() {
	
	}

	function resize($dat) {

	}

	function get_position($client_area=TRUE) {
	}


	function get_size() {

	}

	function value() {
		return( $this->get_text() );
	}

	function get_text() {
		return(trim($this->widget->get_text()));
	}

	function set_text($txt) {
		return($this->widget->set_text($txt));
	}

	function set_visible($v=TRUE) {
		$this->widget->set_visible($v);
	}

	function set_enabled($v=TRUE) {
		$this->enabled = $v;
		$this->widget->set_sensitive($v);
	}

	function get_enabled() {
		return($this->enabled );
	}

	function take_focus() {
		$this->set_focus();
	}

	function grab_focus() {
		$this->set_focus();
	}

	function set_focus() {
		$this->widget->grab_focus();
	}

}



?>